package com.irdstudio.efp.cus.api.rest;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.irdstudio.basic.framework.core.constant.ResponseData;
import com.irdstudio.basic.framework.web.controller.AbstractController;
import com.irdstudio.efp.cus.service.facade.CusWhiteListEService;
import com.irdstudio.efp.cus.service.vo.CusWhiteListEVO;

@RestController
@RequestMapping("/api")
public class CusWhiteListEController extends AbstractController  {
	
	@Autowired
	@Qualifier("cusWhiteListEService")
	private CusWhiteListEService cusWhiteListEService;

	
	/**
	 * 列表数据查询
	 * @param page
	 * @param size
	 * @return
	 */
//	@RequestMapping(value="/cus/white/list/es", method=RequestMethod.POST)
//	public @ResponseBody ResponseData<List<CusWhiteListEVO>> queryCusWhiteListEAll(
//			@RequestBody CusWhiteListEVO vo) {		
//		List<CusWhiteListEVO> outputVo = this.executeQueryList("queryAll", cusWhiteListEService, new Object[]{vo});
//		return getResponseData(outputVo);
//		
//	}
	
	/**
	 * 根据主键查询详情
	 * @return
	 */
	@RequestMapping(value="/cus/white/list/e/{certType}/{certCode}", method=RequestMethod.GET)
	public @ResponseBody ResponseData<CusWhiteListEVO> queryByPk(@PathVariable("certType") String certType,@PathVariable("certCode") String certCode) {		
		CusWhiteListEVO inVo = new CusWhiteListEVO();
				inVo.setCertType(certType);
				inVo.setCertCode(certCode);
		CusWhiteListEVO outputVo = cusWhiteListEService.queryByPk(inVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键删除信息
	 * @param cusWhiteListE
	 * @return
	 */
	@RequestMapping(value="/cus/white/list/e", method=RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody CusWhiteListEVO inCusWhiteListEVo) {		
		int outputVo = cusWhiteListEService.deleteByPk(inCusWhiteListEVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键更新信息
	 * @param inCusWhiteListEVo
	 * @return
	 */
	@RequestMapping(value="/cus/white/list/e", method=RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody CusWhiteListEVO inCusWhiteListEVo) {		
		int outputVo = cusWhiteListEService.updateByPk(inCusWhiteListEVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 新增数据
	 * @param inCusWhiteListEVo
	 * @return
	 */
	@RequestMapping(value="/cus/white/list/e", method=RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertCusWhiteListE(@RequestBody CusWhiteListEVO inCusWhiteListEVo) {
		int outputVo = cusWhiteListEService.insertCusWhiteListE(inCusWhiteListEVo);
		return getResponseData(outputVo);
		
	}
}
